// 网点财务
import request from '@/utils/request'

// 出港结算关系配置-获取列表
export const getRelationshipList = (pageNum, pageSize) => {
  return request.get(
    `/network/finance/selectNetworkOutboundSettlementAll?pageNum=${pageNum}&pageSize=${pageSize}`
  )
}

// 出港结算关系配置-获取网点
export const getOutletsList = () => {
  return request.get(`/network/name/selectAll`)
}

// 显示订单来源列表
export const getOrderSourceList = () => {
  return request.get(`/network/orderSource/selectAll`)
}

// 出港结算关系配置-结算对象(客户)
export const getFinanceList = () => {
  return request.get(`/network/finance/selectAllClient`)
}

// 出港结算关系配置-查询
export const relationshipSearch = (permission) => {
  return request.post(`/network/finance/search`, permission)
}

/**
 * 批量导出
 * @param {*} permission
 * @returns
 */
export const uploadNetworkOutboundSettlement = (permission) => {
  return request({
    url: '/network/finance/uploadNetworkOutboundSettlement',
    method: 'get',
    headers: {
      responseType: 'blob'
    },
    params: permission
  })
}

/**
 * 批量删除
 * @param {*} permission
 * @returns
 */
export const deleteByIds = (permission) => {
  return request({
    url: '/network/finance/deleteByIds',
    method: 'delete',
    params: permission
  })
}

// 出港拉均配置-显示列表
export const getpullEvenList = (a, b) => {
  return request.get(`/network/pullUniform/selectAll?pageNum=${a}&pageSize=${b}`)
}

// 出港拉均配置-查询
export const pullEvenSearch = (permission) => {
  return request.post(`/network/pullUniform/search`, permission)
}

// 科目配置-显示一级科目下拉列表
export const getSubjectFirstList = () => {
  return request.get(`/network/subject/selectSubjectFirst`)
}

// 科目配置-显示一级科目下拉列表
export const getSubjectList = (a, b) => {
  return request.get(`/network/subject/selectAll?pageNum=${a}&pageSize=${b}`)
}

// 科目配置-搜索科目配置
export const subjectSearch = (permission) => {
  return request.post(`/network/subject/search`, permission)
}

// 科目配置-添加科目配置
export const addSubject = (permission) => {
  return request.post(`/network/subject/insert`, permission)
}

// 包仓费其他费用结算-结算科目
export const settleSubjectList = () => {
  return request.get(`/network_settleSubject/selectAll`)
}

// 出港导出-显示出港自动导出配置列表
export const getExportList = (a, b) => {
  return request.get(`/network/export/selectAll?pageNum=${a}&pageSize=${b}`)
}

// 出港导出-搜索科目配置
export const exportSearch = (permission) => {
  return request.post(`/network/export/search`, permission)
}

// 出港导出-批量删除
export const exportDelete = (ids) => {
  return request.post(`/network/export/deleteByIds?ids=${ids}`)
}

// 奖罚分摊结算-显示奖罚分摊结算列表
export const getRewardApportionList = () => {
  return request.get(`/network/rewardApportion/selectAll`)
}

// 奖罚分摊结算-总部结算科目
export const getHqSettleSubjectList = () => {
  return request.get(`/network/HqSettleSubject/selectAll`)
}

// 奖罚分摊结算-搜索奖罚分摊结算
export const rewardApportionSearch = (permission) => {
  return request.post(`/network/rewardApportion/search`, permission)
}

// 奖罚分摊结算-明细汇总
export const collectSearch = (permission) => {
  return request.post(`/network/rewardApportion/collect`, permission)
}

// 包仓费其他费用结算-显示包仓费其他费用结算列表
export const storageChargeList = (pageNum, pageSize) => {
  return request.get(
    `/network/storageCharge/selectAll?pageNum=${pageNum}&pageSize=${pageSize}`
  )
}

// 包仓费其他费用结算-搜索包仓费其他费用结算
export const storageChargeSearch = (permission) => {
  return request.post(`/network/storageCharge/search`, permission)
}

// 包仓费其他费用结算-批量删除

export const storageChargeDelete = (ids) => {
  return request.post(`/network/storageCharge/deleteById?ids=${ids}`)
}

// 客户账单管理-应收账单
export const billPayableList = (pageNum, pageSize) => {
  return request.get(
    `/network/accountReceivable/selectAll?pageNum=${pageNum}&pageSize=${pageSize}`
  )
}

// 客户账单管理-搜索应收账单
export const accountReceivableSearch = (permission) => {
  return request.post(`/network/accountReceivable/search`, permission)
}

// 客户账单管理-应付账单
export const getPayableList = (pageNum, pageSize) => {
  return request.get(
    `/network/billPayable/selectAll?pageNum=${pageNum}&pageSize=${pageSize}`
  )
}

// 客户账单管理-搜索应付账单
export const billPayableSearch = (permission) => {
  return request.post(`/network/billPayable/search`, permission)
}

// 客户账单管理-显示手工账单录入列表
export const handworkBillList = (pageNum, pageSize) => {
  console.log(pageNum, 'ss')
  console.log(pageNum, 'ss')
  return request.get(
    `/network/handworkBill/selectAll?pageNum=${pageNum}&pageSize=${pageSize}`
  )
}

// 客户账单管理-搜索手工账单录入
export const handworkBillSearch = (permission) => {
  return request.post(`/network/handwork/search`, permission)
}

// 客户账单管理-科目结算
export const getnetworkList = () => {
  return request.get(`/network_settleSubject/selectAll`)
}

// 显示网点揽收分润账单_账单明细
export const collectBillList = (pageNum, pageSize) => {
  return request.get(
    `/network/collectBill/selectAll?pageNum=${pageNum}&pageSize=${pageSize}`
  )
}

// 搜索网点揽收分润账单_账单明细
export const collectBillSearch = (permission) => {
  return request.post(`/network/collectBill/search`, permission)
}

// 显示网点揽收分润账单_网点表格
export const billCollectSearch = (permission) => {
  return request.post(`/network/billCollect/network`, permission)
}

// 显示网点揽收分润账单_业务员表格
export const salesmanSearch = (permission) => {
  return request.post(`/network/billCollect/salesman`, permission)
}

// 出港发件费结算-显示异常数据列表
export const getAbnormalList = () => {
  return request.get(`/network/abnormal/selectAll`)
}

// 出港发件费结算-显示结算类型列表
export const getSettleTypeList = () => {
  return request.get(`/network/settleType/selectAll`)
}

// 出港发件费结算-显示付款方式列表
export const getPayTypeList = () => {
  return request.get(`/network/payType/selectAll`)
}

// 出港发件费结算-显示付款方式列表
export const getSettlementTableList = (pageNum, pageSize) => {
  return request.get(
    `/network/settlement/selectNetworkPullUniformAll?pageNum=${pageNum}&pageSize=${pageSize}`
  )
}

// 出港发件费结算-搜索出港结算明细
export const settlementSearch = (permission) => {
  return request.post(`/network/settlement/search`, permission)
}

// 出港发件费结算-显示省份列表
export const getProvinceList = () => {
  return request.get(`/user/provinceCity/province`)
}

// 出港发件费结算-根据省份查询城市列表
export const getCityId = (pid) => {
  return request.get(`/user/provinceCity/selectByProvince?pid=${pid}`)
}

// 出港发件费结算-搜索承包区中转费汇总列表
export const transferMoneySearch = (permission) => {
  return request.post(`/network/transferMoney/search`, permission)
}

// 出港发件费结算-查询业务员中转费汇总
export const salesmanTransferSearch = (permission) => {
  return request.post(`/network/salesmanTransfer/search`, permission)
}

// 出港发件费结算-搜索客户运费汇总
export const customerFreightCollectSearch = (permission) => {
  return request.post(`/network/customerFreightCollect/search`, permission)
}

// 出港报价中心-显示报价类型列表
export const getSelectQuotationAll = () => {
  return request.get(`/network/finance/selectQuotationAll`)
}

// 出港发件费结算-搜索出港报价中心
export const QuotationSearch = (permission) => {
  return request.post(`/network/finance/searchQuotation`, permission)
}

// 显示平台来源列表
export const getPlatformAll = () => {
  return request.get(`/network/platform/selectAll`)
}

// 面单费报价-搜索客户价格列表
export const clientSearch = (permission) => {
  return request.post(`/networkSheetPrice/client/search`, permission)
}
// 面单费报价-显示客户价格列表
export const clientlist = (a, b) => {
  return request.get(`/networkSheetPrice/client/selectAll?pageNum=${a}&pageSize=${b}`)
}

// 面单费报价-修改客户价格
export const updateKhSearch = (permission) => {
  return request.post(`/networkSheetPrice/client/update`, permission)
}

// 面单费报价-搜索业务员列表
export const salesmanTableSearch = (permission) => {
  return request.post(`/networkSheetPrice/salesman/search`, permission)
}
// 面单费报价-显示业务员价格列表
export const salesmanTablelist = (a, b) => {
  return request.get(`/networkSheetPrice/salesman/selectAll?pageNum=${a}&pageSize=${b}`)
}

// 面单费报价-修改业务员价格
export const updateSalesman = (permission) => {
  return request.post(`/networkSheetPrice/salesman/update`, permission)
}

// 面单费报价-搜索承包区列表
export const contractTableSearch = (permission) => {
  return request.post(`/networkSheetPrice/contract/search`, permission)
}

// 面单费报价-修改承包区价格
export const updateContract = (permission) => {
  return request.post(`/networkSheetPrice/contract/update`, permission)
}

// 面单费报价-搜索兜底价格列表
export const underpayTableSearch = (permission) => {
  return request.post(`/networkSheetPrice/underpay/search`, permission)
}

// 面单费报价-修改兜底价格
export const updateUnderpay = (permission) => {
  return request.post(`/networkSheetPrice/underpay/update`, permission)
}

// 补收
// 面单费报价-显示兜底价格列表
export const updateUnderpayAll = (permission) => {
  return request.post(`/networkSheetPrice/underpay/selectAll`, permission)
}
// 面单费报价，添加兜底价格
export const addUpdateUnderpay = (permission) => {
  return request.post(`/networkSheetPrice/underpay/insert`, permission)
}
// 面单费报价-删除兜底价格
export const delUpdateUnderpay = (permission) => {
  return request.post(`/networkSheetPrice/underpay/deleteById`, permission)
}
// 面单费报价-查询兜底价格修改记录明细

export const lookUpdateUnderpay = (permission) => {
  return request.get(
    `
/networkSheetPrice/underpay/detail`,
    permission
  )
}
// 补收

// 面单费补收-搜索面单费补收明细列表
export const feeFillCollectSearch = (permission) => {
  return request.post(`/network/feeFillCollect/detail/search`, permission)
}

// 面单费补收-修改面单费补收明细
export const updateFeeFillCollect = (permission) => {
  return request.post(`/network/feeFillCollect/detail/update`, permission)
}

// 面单费补收-面单费补收汇总
export const feeFillCollectList = (permission) => {
  return request.post(`/network/feeFillCollect/collect`, permission)
}

// 派费直达管理-显示派费直达管理
export const feeThroughTableList = (pageNum, pageSize) => {
  return request.get(
    `/network/feeThrough/selectAll?pageNum=${pageNum}&pageSize=${pageSize}`
  )
}

// 派费直达管理-搜索派费直达管理
export const feeThroughSearch = (permission) => {
  return request.post(`/network/feeThrough/search`, permission)
}

// 派费直达管理-修改派费直达管理
export const updateFeeThrough = (permission) => {
  return request.post(`/network/feeThrough/update`, permission)
}

// 派费直达管理-修改派费直达管理
export const deleteByFeeThroughId = (id) => {
  return request.post(`/network/feeThrough/deleteById?id=${id}`)
}

// 代业务员对客户结算显示全部
export const getListSywy = () => {
  return request.get(`/network/salesmanSettlementClient/selectAll`)
}
// 代业务员对客户结算--搜索
export const searchSywy = (data) => {
  return request.post(
    `/network/salesmanSettlementClient/search`,
    data
  )
}
// 代业务员对客户结算--删除
export const delUpdateSywy = (id) => {
  return request.post(`/network/salesmanSettlementClient/deleteById`)
}
// 代业务员对客户结算--添加
export const addUpdateSywy = (permission) => {
  return request.post(`/network/salesmanSettlementClient/insert`)
}

// 代业务员对客户结算--修改
export const xiuUpdateSywy = (permission) => {
  return request.post(`/network/salesmanSettlementClient/update`, permission)
}
// 代业务元对客户结算--汇总

export const allUpdateSywy = (data) => {
  return request.post(`/network/salesmanSettlementClient/collect`, data)
}
